//
//  PHAssetCollection+Description.swift
//  ai_assettool
//
//  Created by 李旭峰 on 2021/4/10.
//

import Foundation
import Photos

///
extension PHAssetCollectionType {
    public var aiDescription: String {
        if #available(iOS 13.0, *) {
            return self.aiDescription_ios13_after
        } else {
            return self.aiDescription_ios13_before
        }
    }
    
    @available(iOS 13.0, *)
    public var aiDescription_ios13_after: String {
        switch self {
        case .album:return "专辑（album - \(self.rawValue)）"
        case .smartAlbum:return "智能相册（smartAlbum - \(self.rawValue)）"
        default:return "未知（unkonw - \(self.rawValue)）"
        }
    }
    
    fileprivate var aiDescription_ios13_before:String {
        switch self {
        case .album:return "自定义相册（album - \(self.rawValue)）"
        case .smartAlbum:return "智能相册（smartAlbum - \(self.rawValue)）"
        case .moment:return "临时相册（moment - \(self.rawValue)）"
        default:return "未知（unkonw - \(self.rawValue)）"
        }
    }
}
